package com.shop.cereshop.commons.domain.wallet;

import java.io.Serializable;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * <p>
 * 实体类
 * 店铺钱包流水表
 * </p>
 *
 * @author
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@TableName("cere_shop_wallet_transaction")
@ApiModel(value = "CereShopWalletTransaction", description = "店铺钱包流水表")
@AllArgsConstructor
@Builder
public class CereShopWalletTransaction implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 流水ID
   */
  @ApiModelProperty(value = "流水ID")
  @NotNull(message = "流水ID不能为空")
  @TableId(value = "transaction_id", type = IdType.AUTO)
  private Long transactionId;

  /**
   * 店铺ID
   */
  @ApiModelProperty(value = "店铺ID")
  @NotNull(message = "店铺ID不能为空")
  @TableField("shop_id")
  private Long shopId;

  /**
   * 交易类型 1-收入 2-提现 3-退款 4-其他
   */
  @ApiModelProperty(value = "交易类型 1-收入 2-提现 3-退款 4-其他")
  @NotNull(message = "交易类型不能为空")
  @TableField("transaction_type")
  private Integer transactionType;

  /**
   * 交易金额
   */
  @ApiModelProperty(value = "交易金额")
  @NotNull(message = "交易金额不能为空")
  @TableField("amount")
  private BigDecimal amount;

  /**
   * 交易前余额
   */
  @ApiModelProperty(value = "交易前余额")
  @NotNull(message = "交易前余额不能为空")
  @TableField("balance_before")
  private BigDecimal balanceBefore;

  /**
   * 交易后余额
   */
  @ApiModelProperty(value = "交易后余额")
  @NotNull(message = "交易后余额不能为空")
  @TableField("balance_after")
  private BigDecimal balanceAfter;

  /**
   * 关联订单ID
   */
  @ApiModelProperty(value = "关联订单ID")
  @TableField("order_id")
  private Long orderId;

  /**
   * 交易描述
   */
  @ApiModelProperty(value = "交易描述")
  @NotNull(message = "交易描述不能为空")
  @TableField("description")
  private String description;

  /**
   * 备注
   */
  @ApiModelProperty(value = "备注")
  @TableField("remark")
  private String remark;

  /**
   * 创建时间
   */
  @ApiModelProperty(value = "创建时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @TableField("create_time")
  private LocalDateTime createTime;

}
